<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<c-rt:if test="${!empty param.orderId }">
${pu:reqSet('hql', 'from ServiceOrders where orderId=? and returnSt>=? order by serviceId desc ') }
${pu:listAdd('params', param.orderId) }
${pu:listAdd('params', '20') }
${pu:reqSet('serviceOrders', pu:queryByHql(hql, pu:arrayGet('params'), null)) }
${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', param.orderId)) }
<c-rt:if test="${!empty serviceOrders}">
	${pu:reqSet('hql', 'from ServiceOrderProduct where serviceId=?') }
	${pu:reqSet('params', null) }
	${pu:listAdd('params', serviceOrders[0].serviceId) }
	${pu:reqSet('sops', pu:queryByHql(hql, pu:arrayGet('params'), null)) }
</c-rt:if> 
</c-rt:if>
<c-rt:if test="${!empty param.orderProductId || !empty param.orderProdId }">
${pu:reqSet('params', null) }
${pu:reqSet('hql', 'from ServiceOrderProduct where orderProdId=?') }
<c-rt:if test="${!empty param.orderProductId}">
${pu:listAdd('params', pu:toLong(param.orderProductId)) }
</c-rt:if>
<c-rt:if test="${!empty param.orderProdId}">
${pu:listAdd('params', pu:toLong(param.orderProdId)) }
</c-rt:if>
${pu:reqSet('sopsn', pu:queryByHql(hql, pu:arrayGet('params'), null)) }

<c-rt:forEach items="${sopsn}" var="sod" varStatus="i"> 

${pu:reqSet('hql', 'from ServiceOrders where serviceId=? and returnSt>=? order by serviceId desc ') }
${pu:reqSet('params', null) }
${pu:listAdd('params', sod.serviceId) }
${pu:listAdd('params', '20') }
${pu:reqSet('tempso', pu:queryByHql(hql, pu:arrayGet('params'), null)) }
<c-rt:forEach items="${tempso}" var="tem" varStatus="i"> 
	<c-rt:if test="${tem.srcType!=2}">
		${pu:reqSet('so', tempso[0]) }
	</c-rt:if>
</c-rt:forEach>
</c-rt:forEach>
<c-rt:if test="${!empty sopsn && !empty so}">
	<%--${pu:reqSet('so', pu:get('com.yaodian100.ec.order.entity.ServiceOrders', sopsn[0].serviceId)) } --%>
	${pu:reqSet('serviceOrder', so) }
	${pu:reqSet('parms', null) }
	${pu:listAdd('parms', so.serviceId) }
	${pu:reqSet('sops', pu:queryByHql('from ServiceOrderProduct where serviceId=?', pu:arrayGet('parms'), null)) }


${pu:reqSet('params', null) }
${pu:listAdd('params', sops[0].serviceId) }
${pu:reqSet('serviceOrders', pu:queryByHql('from ServiceOrders where serviceId=?', pu:arrayGet('params'), null)) }
${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', serviceOrders[0].orderId)) }
</c-rt:if>
<c-rt:if test="${empty sopsn}">
<c-rt:if test="${!empty param.orderProductId}">
${pu:reqSet('op', pu:get('com.yaodian100.ec.order.entity.OrderProduct', pu:toLong(param.orderProductId))) }
</c-rt:if>
<c-rt:if test="${!empty param.orderProdId}">
${pu:reqSet('op', pu:get('com.yaodian100.ec.order.entity.OrderProduct', pu:toLong(param.orderProdId))) }
</c-rt:if>
${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', op.orderId)) }
</c-rt:if>
</c-rt:if>
<style>
.promo-popup{padding:10px;*padding:10px 0 10px 8px; color:#666;line-height:1.4em; }
.promo-popup h2,.promo-popup h3{font-size:15px;color:#d12e6f; margin-bottom:.8em;}
.promo-popup h3{color:#666;}
.promo-popup p{margin:.5em 0;}
.promo-popup .d-line{background:url(/images/link_dote.gif) repeat-x scroll 0 50%; padding:1px 0;}
.promo-popup ol,.promo-popup ul{margin-bottom:1em;margin-left:2em;}
.promo-popup li{list-style:decimal;}
</style>
<script>
$(function(){
	$('#current_location').html(' > 退款明细');
});
</script>
  <!-- content start --> 
  <div class="content mb-od-dtl"> 
    <!-- 我的訂單 --> 
      <h2>退款明细</h2> 
      <!-- 訂單資訊 --> 
      
      
 <c-rt:if test="${!empty sops}">
      <div class="d-show"> 
        <ul> 
          <li class="w-1of1"><strong>订单编号：</strong>${order.orderId }</li> 
          <li class="w-1of1"><div><strong>退订商品：</strong></div>
          <div>
          
          <c-rt:forEach items="${sops}" var="sop">
          ${pu:reqSet('thisop', pu:get('com.yaodian100.ec.order.entity.OrderProduct', pu:toLong(sop.orderProdId))) }
          <c-rt:if test="${sop.prodTp=='6'}">
			<c-rt:if test="${so.srcType!='2'}">
           ${sop.prodName } ${pu:currency(sop.unitPrice) }×${sop.qty }件<br />
			</c-rt:if>
			<c-rt:if test="${so.srcType=='2'}">
			<c-rt:forEach items="${sop.serviceOrderDetail }" var="sod">  
              <span class="type-${sod.detailTp }">${pu:menuOption('Product.Type', sod.detailTp).name }</span><a href="../../product/product.do?productId=${sod.prodId}">${sod.prodName } </a>${pu:currency(sod.unitPrice) }×${sod.qty }件<br/>
            </c-rt:forEach> 
			</c-rt:if>
          </c-rt:if>
          <c-rt:if test="${sop.prodTp!='6'}">
           
          	<c-rt:forEach items="${sop.serviceOrderDetail }" var="sod">  
              <span class="type-${sod.detailTp }">${pu:menuOption('Product.Type', sod.detailTp).name }</span>
              <c-rt:if test="${sod.detailTp == 0 || sod.detailTp == 1}"><a href="../../product/product.do?productId=${sod.prodId}"></c-rt:if>${sod.prodName } 
              <c-rt:if test="${sod.detailTp == 0 || sod.detailTp == 1}"></a></c-rt:if>
              ${pu:currency(sod.unitPrice) }×${sod.qty }件<br />
            </c-rt:forEach>
            	
          </c-rt:if>
          <c-rt:if test="${thisop.coupon > 0}">（礼券折抵￥ ${pu:rmb(thisop.coupon)}元）<br/>  </c-rt:if>
          
         
                    	<c-rt:forEach items="${order.orderProduct }" var="op" varStatus="opStatus">
                    	<c-rt:if test="${op.prodSpecId==sop.prodSpecId}">
                <c-rt:forEach items="${op.applyCampaigns}" var="ac" varStatus="status2">
	          	
	          	<p>
	          	<c-rt:if test="${ac.active}">
	          		<span class="type-4">优惠</span>
	          	</c-rt:if>
	          	<c-rt:if test="${!ac.active}">
	          		<span class="type-6">优惠</span>（不符合）
	          	</c-rt:if>

	          	<c-rt:if test="${!empty ac.campaignUuid}">
	          	${pu:reqSet('pc', pu:get('com.yaodian100.ec.campaign.entity.Campaign', ac.campaignUuid)) }
	          	</c-rt:if>
	          	<a class="btn-promo" href="javascript:openCampaign_${opStatus.index }_${status2.index }()">${pc.campaignName } </a>
	          
				<script>
				<c-rt:set scope="request" var="campaignDetail">
            	${pu:replaceAll(pc.campaignDetail, '\'', '&#39;')}
            	</c-rt:set>
            	<c-rt:set scope="request" var="campaignDesc">
            	${pu:replaceAll(pc.campaignDesc, '\'', '&#39;')}
            	</c-rt:set>
					function openCampaign_${opStatus.index }_${status2.index }(){
						var dialogId='dialog';
						<%
						String campaignDetail=(String)request.getAttribute("campaignDetail");
						String campaignDesc=(String)request.getAttribute("campaignDesc");
						campaignDetail=campaignDetail.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						campaignDesc=campaignDesc.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						request.setAttribute("campaignDetail", campaignDetail);
						request.setAttribute("campaignDesc", campaignDesc);
						%>
						title='活动信息';
						campaignTitle='${pu:replaceAll(pc.campaignName, '\'', '&#39;')}';
						desc= '${campaignDesc}';
						detail='${campaignDetail}';
						startDate= '<fmt-rt:formatDate value="${pc.startDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						endDate= '<fmt-rt:formatDate value="${pc.endDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						url= '${pc.campaignUrl}';
						width= 300;
						height= 'auto';

						var content=compositeCampaign(campaignTitle, desc, detail, startDate, endDate, url);
						openDialog(title, content,width,height);
						$( '#'+dialogId).dialog('option', 'position', 'top' );
					}
				</script>

	          	</p>
	          	</c-rt:forEach>
	          	</c-rt:if>
	          	</c-rt:forEach>
          </c-rt:forEach> 
          </div> 
            
          </li> 
          <li class="w-1of1"><strong>总退还金额：</strong>${pu:currency(serviceOrders[0].realCash+serviceOrders[0].realBonus+serviceOrders[0].realCoupon+serviceOrders[0].realBenefit+serviceOrders[0].realMyWallet+serviceOrders[0].realInstallmentFee+serviceOrders[0].realGiftcardBalance)}
          (实付金额${pu:currency(serviceOrders[0].realCash+serviceOrders[0].realBenefit+serviceOrders[0].realMyWallet+serviceOrders[0].realInstallmentFee )}＋礼品卡${pu:currency(serviceOrders[0].realGiftcardBalance) }＋积分折抵${pu:currency(serviceOrders[0].realBonus) }[<c-rt:if test=  "${not empty order.orderBonusCampaign}">${serviceOrders[0].realBonus * order.orderBonusCampaign.offsetRate}</c-rt:if><c-rt:if test = "${empty order.orderBonusCampaign}">0</c-rt:if>积分]＋礼卷${pu:currency(serviceOrders[0].realCoupon) })</li> 
          <%--<li class="w-1of1"><strong>退还使用的购物金：</strong>${pu:currency(serviceOrders[0].realBonus) }</li> --%>           
          
          <li class="w-1of1"><div><strong>退还方式：</strong></div>
          <div>
          	  <c-rt:if test="${serviceOrders[0].realGiftcardBalance>0}">
	          	${pu:currency(serviceOrders[0].realGiftcardBalance) }退回我的礼品卡 <br />
	          </c-rt:if>   	
          	  <c-rt:choose>
          	  <c-rt:when test="${serviceOrders[0].paymentTp=='50'||serviceOrders[0].paymentTp=='70'||serviceOrders[0].paymentTp=='80'}">
          	  	<c-rt:if test="${serviceOrders[0].realMyWallet>0}">
	      			${pu:currency(serviceOrders[0].realMyWallet) }存入我的耀点100 - 账户余额 <br>
	      		</c-rt:if>	      		
	      		<c-rt:if test="${!empty order.paymentId}">
	      		${pu:reqSet('thirdpartyTransfer', pu:get('com.yaodian100.ec.payment.entity.ThirdPartyTransfer', order.paymentId)) }
	      		</c-rt:if>
	      		<c-rt:if test="${!empty thirdpartyTransfer}">
	      			<c-rt:if test="${thirdpartyTransfer.src=='01'}">
	      				${pu:currency(serviceOrders[0].realCash) }退回银联帐户<br>
	      			</c-rt:if>
	      			<c-rt:if test="${thirdpartyTransfer.src=='02'}">
	      				${pu:currency(serviceOrders[0].realCash) }退回财付通帐户<br>
	      			</c-rt:if>
	      			<c-rt:if test="${thirdpartyTransfer.src=='03'}">
	      				${pu:currency(serviceOrders[0].realCash) }退回交易原支付银行卡/快钱帐户<br>
	      			</c-rt:if>
	      			<c-rt:if test="${thirdpartyTransfer.src=='04'}">
	      				${pu:currency(serviceOrders[0].realCash) }退回交易原支付银行卡/支付宝帐户<br>
	      			</c-rt:if>
	      			<c-rt:if test="${thirdpartyTransfer.src=='06'}">
	      				${pu:currency(serviceOrders[0].realCash + serviceOrders[0].realInstallmentFee) }退回交易原支付信用卡/快钱帐户<br>
	      			</c-rt:if>
      			</c-rt:if>
          	  </c-rt:when>
          	  <c-rt:otherwise>
          	  ${pu:currency(serviceOrders[0].realMyWallet + serviceOrders[0].realCash) }存入我的耀点100 - 账户余额 <br />
          	  </c-rt:otherwise>
          	  </c-rt:choose>         
	          
	          <c-rt:if test="${serviceOrders[0].realBonus>0}">
	          	${serviceOrders[0].realBonus * order.orderBonusCampaign.offsetRate}存入我的耀点100-我的积分帐户 <br />
	          </c-rt:if>          	
          </div></li>
          <li class="w-1of1"><div><strong>退款说明：</strong></div></li>
        </ul> 
      </div>
       <ul style="margin-left: 3em;" class="li-w1">
            <li>．退款方式与时间将依据支付方式与而有不同，可查看<a target="_blank" href="/help/7_refunetime.html">退款方式与时间说明</a>做进一步了解。</li>
            <li>．有关货到付款手续费和运费之退款，请叁考<a target="_blank" href="/help/7_refunetime.html">退款方式与时间说明</a>。</li>
            <li>．退至我的账户余额中的款项，您可于1个工作天后至<a href="/ecmall/member/myBank/myBank.do" target="_blank">账户余额</a>查询，并可通过邮局汇款以及银行转账的方式进行提现。</li>
            <li>．退回的积分，您可进入<a href="/ecmall/member/myBonus/tomybonus.do" target="_blank">我的积分</a> 查询。</li> 
            <li>．退回的礼品卡，您可进入<a href="/ecmall/member/myGiftcard/tomygiftcard.do" target="_blank">我的礼品卡</a> 查询。</li> 
          </ul>
</c-rt:if>








<c-rt:if test="${empty sops}">
      <div class="d-show"> 
        <ul> 
          <li class="w-1of1"><strong>订单编号：</strong>${order.orderId }</li> 
          <li class="w-1of1"><div><strong>退订商品：</strong></div>
          <div>
          <c-rt:forEach items="${order.orderProduct}" var="op">
          <c-rt:if test="${op.prodTp=='6'}">
           <a href="../../product/product.do?productId=${op.prodId}">${op.prodName }</a> ${pu:currency(op.unitPrice) }×${op.qty }件<br />
          	
          </c-rt:if>
          <c-rt:if test="${op.prodTp!='6'}">
           
          	<c-rt:forEach items="${op.orderProductDetail }" var="od">  
              <span class="type-${od.detailTp }">${pu:menuOption('Product.Type', od.detailTp).name }</span>
              <a href="../../product/product.do?productId=${od.prodId}">${od.prodName } 
              </a>
              ${pu:currency(od.unitPrice) }×${od.qty }件<br />
            </c-rt:forEach> 
          </c-rt:if>
          <c-rt:if test="${op.coupon > 0}">（礼券折抵￥ ${pu:rmb(op.coupon)}元）<br/> </c-rt:if>
          </c-rt:forEach> 
          <c-rt:forEach items="${op.applyCampaigns}" var="ac" varStatus="status2">
	          	
	          	<p>
	          	<c-rt:if test="${ac.active}">
	          		<span class="type-4">优惠</span>
	          	</c-rt:if>
	          	<c-rt:if test="${!ac.active}">
	          		<span class="type-6">优惠</span>（不符合）
	          	</c-rt:if>
	          	
	          	
	          	${pu:reqSet('pc', pu:get('com.yaodian100.ec.campaign.entity.Campaign', ac.campaignUuid)) }
	          	
	          <a class="btn-promo" href="javascript:openCampaign_${opStatus.index }_${status2.index }()">${pc.campaignName } </a>
	          
				<script>
				<c-rt:set scope="request" var="campaignDetail">
            	${pu:replaceAll(pc.campaignDetail, '\'', '&#39;')}
            	</c-rt:set>
            	<c-rt:set scope="request" var="campaignDesc">
            	${pu:replaceAll(pc.campaignDesc, '\'', '&#39;')}
            	</c-rt:set>
					function openCampaign_${opStatus.index }_${status2.index }(){
						var dialogId='dialog';
						<%
						String campaignDetail=(String)request.getAttribute("campaignDetail");
						String campaignDesc=(String)request.getAttribute("campaignDesc");
						campaignDetail=campaignDetail.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						campaignDesc=campaignDesc.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						request.setAttribute("campaignDetail", campaignDetail);
						request.setAttribute("campaignDesc", campaignDesc);
						%>
						title='活动信息';
						campaignTitle='${pu:replaceAll(pc.campaignName, '\'', '&#39;')}';
						desc= '${campaignDesc}';
						detail='${campaignDetail}';
						startDate= '<fmt-rt:formatDate value="${pc.startDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						endDate= '<fmt-rt:formatDate value="${pc.endDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						url= '${pc.campaignUrl}';
						width= 300;
						height= 'auto';

						var content=compositeCampaign(campaignTitle, desc, detail, startDate, endDate, url);
						openDialog(title, content,width,height);
						$( '#'+dialogId).dialog('option', 'position', 'top' );
					}
				</script>

	          	</p>
	          	</c-rt:forEach>
          </div> 
            
          </li> 
          <li class="w-1of1"><strong>总退还金额：</strong>${pu:currency(order.cash+order.bonus+order.benefit+order.myWallet )} (实付金额${pu:currency(order.cash+order.benefit+order.myWallet )}＋积分折抵${pu:currency(order.bonus) }[<c-rt:if test=  "${not empty order.orderBonusCampaign}">${order.bonus * order.orderBonusCampaign.offsetRate}</c-rt:if><c-rt:if test = "${empty order.orderBonusCampaign}">0</c-rt:if>积分])</li>
          <%--<li class="w-1of1"><strong>退还使用的购物金：</strong>${pu:currency(order.bonus) }</li> --%>          
          <li class="w-1of1"><div><strong>退还方式：</strong></div>
          <div>
          	<c-rt:if test="${order.myWallet>0}">
	          ${pu:currency(order.myWallet) }存入我的耀点100 - 账户余额 <br />
	        </c-rt:if>
	        <c-rt:if test="${order.bonus>0}">
	          ${order.bonus * order.orderBonusCampaign.offsetRate}存入我的耀点100-我的积分帐户 <br />
	        </c-rt:if>
          	</div></li>
            
          <li class="w-1of1"><div><strong>退款说明：</strong></div></li>          
        </ul> 
      </div> 
      <ul style="margin-left: 3em;" class="li-w1">
            <li>．退款方式与时间将依据支付方式与而有不同，可查看<a target="_blank" href="/help/7_refunetime.html">退款方式与时间说明</a>做进一步了解。</li>
            <li>．有关货到付款手续费和运费之退款，请叁考<a target="_blank" href="/help/7_refunetime.html">退款方式与时间说明</a>。</li>
            <li>．退至我的账户余额中的款项，您可于1个工作天后至<a href="/ecmall/member/myBank/myBank.do" target="_blank">账户余额</a>查询，并可通过邮局汇款以及银行转账的方式进行提现。</li>
            <li>．退回的积分，您可进入<a href="/ecmall/member/myBonus/tomybonus.do" target="_blank">我的积分</a> 查询。</li> 
          </ul>
</c-rt:if>








      <!-- 訂單資訊 --> 
   
   <!-- 我的訂單 --> 
  </div> 
  <!-- content end --> 
 